// noinspection NpmUsedModulesInstalled,JSUnusedGlobalSymbols
import request from '@/utils/request'

export default {
  // 修改
  updateArticle(article) {
    return request({
      url: '/itservice/articleadmin/update',
      method: 'post',
      data: article
    })
  },

  // 添加
  addArticle(article) {
    return request({
      url: '/itservice/articleadmin/addArticle',
      method: 'post',
      data: article
    })
  },

  // 删除
  removeArticleById(id) {
    return request({
      url: `/itservice/articleadmin/removeArticleById/${id}`,
      method: 'delete'
    })
  },

  // 分页查看
  getPageArticle(page, limit) {
    return request({
      url: `/itservice/articleadmin/pageArticleAndClasses/${page}/${limit}`,
      method: 'get'
    })
  },

  // 根据id查看article信息
  getArticleInfoById(articleId) {
    return request({
      url: `/itservice/articleadmin/getArticleById/${articleId}`,
      method: 'get'
    })
  },

  // 关键字搜索
  searchArticle(keyword) {
    return request({
      url: `/itservice/articleadmin/searchArticle/${keyword}`,
      method: 'get'
    })
  },

  // 批量删除
  batchDelete(ids) {
    return request({
      url: `/itservice/articleadmin/batchDelete`,
      method: 'delete',
      data: ids
    })
  },

  // 更改轮播图状态
  changeState(articleId) {
    return request({
      url: `/itservice/articleadmin/changeState/${articleId}`,
      method: 'get'
    })
  },

  //8 一键更改视频状态
  batchChangeArticleState(state) {
    return request({
      url: `/itservice/articleadmin/batchChangeArticleState/${state}`,
      method: 'get'
    })
  },

  //9 查看文章分类
  getAllArticleClasses() {
    return request({
      url: '/itservice/articleadmin/getAllArticleClasses',
      method: 'get'
    })
  },

  //10 查看文章分类
  getArtilceListByClassesId(articleClassesId) {
    return request({
      url: `/itservice/articleadmin/getArtilceListByClassesId/${articleClassesId}`,
      method: 'get'
    })
  }
}
